<%@page import="java.util.List"%>
<%@page import="complex.dto.Player"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="Sat, 01 Dec 2001 00:00:00 GMT">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<link href="resources/bootstrap.css" rel="stylesheet" />

<%
	List<Player> players = (List<Player>) request.getAttribute("players");
%>

<title>Insert title here</title>
</head>
<body class="container">
	<h4>Пошук</h4>
	<div>
	<form method="post" action="search.do">
		<div class="input-group">
			<input type="text" class="form-control" name="search" placeholder="Ім'я гравця" />
			<hr/>
			<input type="submit" class="btn btn-primary" name1="Пошук" value="Пошук" />
		</div>
	</form>
	</div>
	
	<%if (players != null) {%>
	<div class="panel panel-info" >
		<div class="panel-heading"><h4>Результати пошуку</h4></div>
		<div class="panel-body">
			<table
				class="table table-hover table-condensed table-responsive table-bordered table-striped">
				<thead>
					<th>Ім'я</th>
					<th>Прізвище</th>
					<th>Дата народження</th>
				</thead>
				<tbody>
					<%
						for (Player p : players) {
					%>
					<tr>
						<td><%=p.getFirstName()%></td>
						<td><%=p.getLastName()%></td>
						<td><%=p.getBirthDate().getTime()%></td>
					</tr>
					<%
						}
					%>
				</tbody>
			</table>
		</div>
	</div>
	<%} %>
	
</body>
</html>